<%@ page language="java" import="java.util.*" pageEncoding="utf-8" %>
<%@ include file="/base/base.jsp"%>
<%@ include file="/base/database.jsp"%>

	<%
		String stuID=request.getParameter("stuID");
	   
		Connection conn=getConn();
		
		String sql="select * from sys_student where stuID=?";
		
		PreparedStatement pstmt=conn.prepareStatement(sql);
		
		pstmt.setString(1,stuID);
		
		ResultSet rs=pstmt.executeQuery();
		
		String rs_stuID="";
		String rs_classID="";
		String rs_stuName="";
		String rs_sex="";
		String rs_address="";
		String rs_stuTel="";
		String rs_contact="";
		String rs_contactTel="";
		
		if(rs.next()){
			
			rs_stuID=rs.getString("stuID");
			rs_classID=rs.getString("classID");
			rs_stuName=rs.getString("stuName");
			rs_sex=rs.getString("sex");
			rs_address=rs.getString("address");
			rs_stuTel=rs.getString("stuTel");
			rs_contact=rs.getString("contact");
			rs_contactTel=rs.getString("contactTel");
		}
		
		session.setAttribute("rs_stuID", rs_stuID);
		session.setAttribute("rs_classID",rs_classID);
		session.setAttribute("rs_stuName", rs_stuName);
		session.setAttribute("rs_sex",rs_sex);
		session.setAttribute("rs_address",rs_address);
		session.setAttribute("rs_stuTel", rs_stuTel);
		session.setAttribute("rs_contact",rs_contact);
		session.setAttribute("rs_contactTel", rs_contactTel);
		
		if(pstmt!=null){
			pstmt.close();
		}
		if(conn!=null){
			conn.close();
		}
		
		process(request,response,"/page/student/student_search.jsp");
		
		%>